package com.ewanghuiju.app.ui.message.activity;

import android.view.View;

import com.ewanghuiju.app.R;
import com.ewanghuiju.app.app.Constants;
import com.ewanghuiju.app.base.BaseActivity;
import com.ewanghuiju.app.base.contract.message.MessageContract;
import com.ewanghuiju.app.presenter.message.MessageCenterPresenter;
import com.ewanghuiju.app.util.StartActivityUtil;
import com.ewanghuiju.app.util.nodoubleclick.AntiShake;
import com.gyf.immersionbar.ImmersionBar;

import butterknife.OnClick;

/**
 * @author sj  qq:751943509
 * @class 消息中心页面
 * @time 2020/2/19
 */
public class MessageCenterActivity extends BaseActivity<MessageCenterPresenter> implements MessageContract.View {

    @Override
    protected int getLayout() {
        return R.layout.activity_message_center;
    }

    @Override
    protected void initEventAndData() {
    }

    @OnClick({R.id.layout_setting_message, R.id.layout_activity_message, R.id.layout_geren_message})
    public void doClick(View view) {
        if (AntiShake.check(view.getId())) {    //判断是否多次点击
            return;
        }
        switch (view.getId()) {
            case R.id.layout_setting_message:
                new StartActivityUtil(mContext, MessageListActivity.class).putExtra(Constants.MESSAGE_TYPE, Constants.SETTING_MESSAGE)
                        .startActivity(true);
                break;

            case R.id.layout_activity_message:
                new StartActivityUtil(mContext, MessageListActivity.class).putExtra(Constants.MESSAGE_TYPE, Constants.ACTIVITY_MESSAGE)
                        .startActivity(true);
                break;

            case R.id.layout_geren_message:
                new StartActivityUtil(mContext, MessageListActivity.class).putExtra(Constants.MESSAGE_TYPE, Constants.GEREN_MESSAGE)
                        .startActivity(true);
                break;
            default:
                break;
        }
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .titleBar(mToolbar, true)
//                .transparentBar()
                .statusBarDarkFont(true)
                .navigationBarDarkIcon(true)
                .init();
    }

    @Override
    protected void initInject() {
        getActivityComponent().inject(this);
    }


    @Override
    protected void setOptionsMenu() {
        super.setOptionsMenu();
        if (menuItemFirse != null) {
            menuItemFirse.setVisible(true);
            menuItemFirse.setIcon(R.mipmap.icon_message_show);
            menuItemFirse.setTitle("");
        }
    }

    @Override
    protected int getTitleIntText() {
        return R.string.message_center_title;
    }

    @Override
    public void showContent(String list) {

    }

    @Override
    public void showMoreContent(String list) {

    }
}
